#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
#define int long long
struct Matrix {
  int a[3][3];
  Matrix() { memset(a, 0, sizeof(a)); }
  Matrix operator*(const Matrix &b) const {
    Matrix res;
    for (int i = 1; i <= 2; ++i)
      for (int j = 1; j <= 2; ++j)
        for (int k = 1; k <= 2; ++k)
          res.a[i][j] = (res.a[i][j] + a[i][k] * b.a[k][j] % mod) % mod;
    return res;
  }
} ans, base;

void qpow(int b) {
  while (b) {
    if (b & 1) ans = ans * base;
    base = base * base;
    b >>= 1;
  }
}

signed main() {
  int n;
  cin >> n;
  if (n <= 2) return puts("1"), 0;

  base.a[1][1] = base.a[1][2] = base.a[2][1] = 1;
  ans.a[1][1] = ans.a[1][2] = 1;
  qpow(n - 2);
  printf("%lld\n", ans.a[1][1] % mod);
}
